<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<script>
  let target = {
    a: 1
  }
  let ovj2 = { a: 3, b: 2 }
  let obj3 = { c: 3 }
  // Object.assign(target, ovj2, obj3)  用于复制到目标对象中，返回值是target对象,如果目标对象或源对象有同名属性，则后面的属性会覆盖前面的属性

  let ret = Object.assign(target, ovj2, obj3)
  console.log(target);
  console.log(ret);
  let sourceobj = {
    a: {
      b: 1
    }

  }
  let tar = {
    c: 3
  }
  let ret2 = Object.assign(tar, sourceobj)
  tar.a.b = 5
  console.log(ret2);
  console.log(tar.a.b);
  // 用于检查两个值是否相等，和===差不多
  console.log(Object.is(1, 2));
  console.log(Object.is(1, 1));
</script>

<body>

</body>

</html>